﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Agents.Admin
{
    public partial class NotificationsPage : System.Web.UI.Page
    {
        /// <summary>
        /// Occurs when the page is loaded or being postback
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
        }

        /// <summary>
        /// Redirecting the admin back to his home page
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void backBtn_Click(object sender, EventArgs e)
        {
            Response.Redirect("~/Admin/AdminMenu.aspx");
        }

        /// <summary>
        /// Takes care of the page indexing of the DataGrid
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void dgLackNotifications_PageIndexChanged(object sender, DataGridPageChangedEventArgs e)
        {
            // Changing the data grid viewing to the selected index
            dgLackNotifications.CurrentPageIndex = e.NewPageIndex;

            // Binding the data grid data
            dgLackNotifications.DataBind();
        }

        /// <summary>
        /// Takes care of the page indexing of the DataGrid
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void dgDeadStockNotifications_PageIndexChanged(object sender, DataGridPageChangedEventArgs e)
        {
            // Changing the data grid viewing to the selected index
            dgDeadStockNotifications.CurrentPageIndex = e.NewPageIndex;

            // Binding the data grid data
            dgDeadStockNotifications.DataBind();
        }

        /// <summary>
        /// Takes care of the page indexing of the DataGrid
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void dgLocationBasedNotifications_PageIndexChanged(object sender, DataGridPageChangedEventArgs e)
        {
            // Changing the data grid viewing to the selected index
            dgLocationBasedNotifications.CurrentPageIndex = e.NewPageIndex;

            // Binding the data grid data
            dgLocationBasedNotifications.DataBind();
        }
    }
}